<?php 

class workerThread extends Thread{
    private $i;

    public function __construct($i)
    {
        $this->i = $i;
    }

    public function run(){
        while(true){
            echo $this->i;
            sleep(1);
        }
    }
}

$workers = [];
for($i=0;$i<10;$i++){
    $workers[$i] = new workerThread($i);

    $workers[$i]->start();
}